<template>
  <el-breadcrumb separator="/">
    <el-breadcrumb-item :to="{ path: '/index' }">
      首页
    </el-breadcrumb-item>
    <template v-if="route.path !== '/index'">
      <el-breadcrumb-item
        :to="{ path: item.path }"
        v-for="item in route.matched"
        :key="item.name"
      >
        {{ item.meta.title }}
      </el-breadcrumb-item>
    </template>
  </el-breadcrumb>
</template>

<script setup lang="ts">
import { useRoute } from 'vue-router'
const route = useRoute()
console.log(route.matched)
</script>

<style lang="less" scoped></style>
